package com.easy.dn.widget;

import android.os.CountDownTimer;
import android.widget.TextView;

import dn.easy.com.easyto.R;


/* 定义一个倒计时的内部类 */
public class TimeCount extends CountDownTimer {
	private TextView checking;

	public TimeCount(long millisInFuture, long countDownInterval, TextView btn) {
		super(millisInFuture, countDownInterval);// 参数依次为总时长,和计时的时间间隔
		this.checking = btn;
	}

	@Override
	public void onFinish() {// 计时完毕时触发
		checking.setText(R.string.re_rev);
		checking.setClickable(true);
	}

	@Override
	public void onTick(long millisUntilFinished) {// 计时过程显示R.string.re_rev
		checking.setClickable(false);
		checking.setText(millisUntilFinished / 1000 + "秒");
	}
}